package lesson20;

import java.io.IOException;

public class Person 
{
	private String name;

	void setName(String name)
	{
		this.name = name;
	}
	
	boolean hasSameName(Person other) throws PersonException
	{
			int[] x = new int[3];
			if(10 < x.length)
				x[10] = 4;
			try
			{
				
				//boolean b = this.name.equals(other.name);
				throw new IOException();
				//System.out.println("Some text between all");
				//return b;
			}
			catch(IOException npe)
			{
				System.out.println("io catched");
				throw new PersonException("Person failed", npe);
			}
			catch(Exception npe)
			{
				System.out.println("global catched");
				throw new PersonException("Person failed", npe);
			}
			finally
			{
				try
				{
					throw new NullPointerException();
				//System.out.println("Finally!");
				}
				catch(NullPointerException e) 
				{
					System.out.println("Aha!");
				}
			}
			
	}
}
